import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   redirect: '/login'
    // },

    {
      path: '/login',
      component: () => import('@/views/login/LoginPage.vue')
      // name: '登录'
    },
    {
      // path: '/layout/LayoutContainer',
      path: '/',
      component: () => import('@/views/layout/LayoutContainer.vue'),
      redirect: '/family/index',
      // name: '系统',
      children: [
        // {
        //   path: '/layout/LayoutContainer',
        //   redirect: '/family/index'
        // },
        {
          path: '/family/index',
          component: () => import('@/views/family/Index.vue'),
          name: '首页'
        },
        {
          path: '/family/generation',
          component: () => import('@/views/family/Generation.vue'),
          name: '辈分管理'
        },
        {
          path: '/family/member',
          component: () => import('@/views/family/Member.vue'),
          name: '成员管理'
        },
        {
          path: '/family/relation',
          component: () => import('@/views/family/Relation.vue'),
          name: '成员关系'
        },
        {
          path: '/user/avatar',
          component: () => import('@/views/user/UserAvatar.vue'),
          name: '更换头像'
        },
        {
          path: '/user/password',
          component: () => import('@/views/user/UserPassword.vue'),
          name: '重置密码'
        },
        {
          path: '/user/profile',
          component: () => import('@/views/user/UserProfile.vue'),
          name: '个人基本信息'
        }
      ]
    }
  ]
})

export default router
